import { post } from '@/utils/request'

// 客服列表
export const getCpUserList = (p) => post(`/service-upms/b/cpUser/v1/pageList`, p)
// 新增客服
export const addCpUser = (p) => post(`/service-upms/b/cpUser/v1/add`, p)
// 删除客服
export const delCpUser = (p) => post(`/service-upms/b/cpUser/v1/del/${p.id}`, p, 'get')
// 查询客服
export const searchCpUser = (p) => post(`/service-upms/b/cpUser/v1/view/${p.id}`, p, 'get')
// 编辑客服
export const editCpUser = (p) => post(`/service-upms/b/cpUser/v1/modify`, p)
// 离职客服
export const quitCpUser = (p) => post(`/service-upms/b/cpUser/v1/quit/${p.id}`, p, 'get')
// 重置客服密码
export const resetCpUser = (p) => post(`/service-upms/b/cpUser/v1/resetPwd/${p.id}`, p, 'get')
// 锁定客服
export const lockCpUser = (p) => post(`/service-upms/b/cpUser/v1/lock/${p.id}/${p.status}`, p, 'get')
// 客服关联角色
export const modifyByUserId = (p) => post(`/service-upms/b/cpUser/v1/modifyByUserId`, p)
// 查询客服的角色id
export const getRolesByUserId = (p) => post(`/service-upms/b/cpUser/v1/queryRoleIdsByUserId/${p}`, p, 'get')

// 角色列表
export const getRoleList = (p) => post(`/service-upms/b/cpRole/v1/pageList`, p)
// 新增角色
export const addRole = (p) => post(`/service-upms/b/cpRole/v1/add`, p)
// 删除角色
export const delRole = (p) => post(`/service-upms/b/cpRole/v1/del/${p.id}`, p, 'get')
// 查询角色
export const searchRole = (p) => post(`/service-upms/b/cpRole/v1/view/${p.id}`, p, 'get')
// 编辑角色
export const editRole = (p) => post(`/service-upms/b/cpRole/v1/modify`, p)
// 改变角色状态
export const changeRoleStatus = (p) => post(`/service-upms/b/cpRole/v1/changeStatus/${p.id}/${p.status}`, p, 'get')
// 查询角色拥有用户id列表
export const getUserInfoByRoleId = p => post(`/service-upms/b/cpRole/v1/queryUserIdsByRoleId/${p}`, p, 'get')
// 客服角色关联角色用户
export const userModifyByRoleId = p => post(`/service-upms/b/cpRole/v1/modifyUserRoleByRoleId`, p)

// 根据角色查询权限
export const getAuthorityById = p => post(`/service-upms/b/cpRole/v1/queryPermissionIdsByRoleId/${p}`, p, 'get')
// 保存权限
export const modifyByRoleId = p => post(`/service-upms/b/cpRole/v1/modifyPermissionByRoleId`, p)
